import { applyMiddleware, legacy_createStore as createStore } from 'redux'

// 导入合并的reducer
import reducers from './reducers'

// 导入redux-devtools-extension扩展工具
import { composeWithDevTools } from 'redux-devtools-extension'
// 导入处理异步请求的thunk中间件
import { thunk } from 'redux-thunk'
// 创建store并传递reducer
// createStore的参数2，可以传递一个中间件，并使用 applyMiddleware来应用

const store = createStore(reducers, composeWithDevTools(applyMiddleware(thunk)))
export default store
